//
//  ActivityTableViewCell.m
//  UGoods
//
//  Created by dllo on 16/1/23.
//  Copyright © 2016年 蓝鸥科技.李贺. All rights reserved.
//

#import "ActivityTableViewCell.h"
#import "ActivityModel.h"
#import <UIImageView+WebCache.h>
#import "ConstantsDefine.h"
@interface ActivityTableViewCell ()

@property (nonatomic, retain) UIImageView *activityImageView;

@end

@implementation ActivityTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.activityImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:_activityImageView];
        [_activityImageView release];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    _activityImageView.frame = CGRectMake(10 * WIDTH, 10 * HEIGHT, self.contentView.frame.size.width - 20 * WIDTH, self.contentView.frame.size.height - 20 * HEIGHT);
}

- (void)setModel:(ActivityModel *)model {
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
   
    [_activityImageView sd_setImageWithURL:[NSURL URLWithString:model.img_url] placeholderImage:[UIImage imageNamed:@"place"]];
}


@end
